package com.kfh.ybracelet.bean;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.List;

/**
 * Created by Administrator on 2015/8/17.
 */
public class BabyDetailsResult implements Parcelable {

    public DataEntity data;

    public int mylevel;
    public int code;
    public String code_msg;

    public List<KeepEntity> keep;

    public static class DataEntity implements Parcelable {
        public String childName;
        public String sex;
        public String picUrl;
        public String birthDay;
        public String phoneNum;


        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeString(this.childName);
            dest.writeString(this.sex);
            dest.writeString(this.picUrl);
            dest.writeString(this.birthDay);
            dest.writeString(this.phoneNum);
        }

        public DataEntity() {
        }

        protected DataEntity(Parcel in) {
            this.childName = in.readString();
            this.sex = in.readString();
            this.picUrl = in.readString();
            this.birthDay = in.readString();
            this.phoneNum = in.readString();
        }

        public static final Creator<DataEntity> CREATOR = new Creator<DataEntity>() {
            @Override
            public DataEntity createFromParcel(Parcel source) {
                return new DataEntity(source);
            }

            @Override
            public DataEntity[] newArray(int size) {
                return new DataEntity[size];
            }
        };
    }

    public static class KeepEntity implements Parcelable {

        public int level;
        public String name;
        public String phoneNum;
        public String imgUrl;
        public String id;

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeInt(this.level);
            dest.writeString(this.name);
            dest.writeString(this.phoneNum);
            dest.writeString(this.imgUrl);
            dest.writeString(this.id);
        }

        public KeepEntity() {
        }

        protected KeepEntity(Parcel in) {
            this.level = in.readInt();
            this.name = in.readString();
            this.phoneNum = in.readString();
            this.imgUrl = in.readString();
            this.id = in.readString();
        }

        public static final Parcelable.Creator<KeepEntity> CREATOR = new Parcelable.Creator<KeepEntity>() {
            @Override
            public KeepEntity createFromParcel(Parcel source) {
                return new KeepEntity(source);
            }

            @Override
            public KeepEntity[] newArray(int size) {
                return new KeepEntity[size];
            }
        };
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeParcelable(this.data, flags);
        dest.writeInt(this.mylevel);
        dest.writeInt(this.code);
        dest.writeString(this.code_msg);
        dest.writeTypedList(keep);
    }

    public BabyDetailsResult() {
    }

    protected BabyDetailsResult(Parcel in) {
        this.data = in.readParcelable(DataEntity.class.getClassLoader());
        this.mylevel = in.readInt();
        this.code = in.readInt();
        this.code_msg = in.readString();
        this.keep = in.createTypedArrayList(KeepEntity.CREATOR);
    }

    public static final Parcelable.Creator<BabyDetailsResult> CREATOR = new Parcelable.Creator<BabyDetailsResult>() {
        @Override
        public BabyDetailsResult createFromParcel(Parcel source) {
            return new BabyDetailsResult(source);
        }

        @Override
        public BabyDetailsResult[] newArray(int size) {
            return new BabyDetailsResult[size];
        }
    };
}
